cmake_minimum_required(VERSION 2.8)



#project client

project(Raytracer)


set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/builds/lib/")



add_custom_command(
	TARGET 
	Raytracer
	POST_BUILD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/builds/lib/debug/debug"
)



#Generate a list of source files


file(
	
	GLOB_RECURSE
	
	source_files
	
	src/*.cpp

)



file(
	
	GLOB_RECURSE
	
	public_header_files
	
	publicInterfaces/*.h

)



file(
	
	GLOB_RECURSE
	
	private_header_files
	
	privateInterfaces/*.h

)



include_directories(publicInterfaces)

include_directories(privateInterfaces)

# project interfaces
include_directories(../RaytracerApp/publicInterfaces)
include_directories(../Image/publicInterfaces)
include_directories(../Math/publicInterfaces)
include_directories(../Objects/publicInterfaces)
include_directories(${Boost_INCLUDE_DIRS})

link_directories(../builds/lib)

if(WIN32)
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /Ot /GL")
else()
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
endif()


#compile

add_executable(
	
	Raytracer
	
	${source_files}
	
	${public_header_files}
	
	${private_header_files}

)



#Link

target_link_libraries(	
	Raytracer
	RaytracerApp
	Image
	Objects
	${Boost_LIBRARIES}
)
